package client.dialog;

import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;

import java.util.Optional;

public class ConfirmDialog {
    public static boolean show(String title, String content) {
        Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
        alert.setTitle(title);
        alert.setHeaderText(null);
        alert.setContentText(content);

        // 加载自定义 CSS 样式
        alert.getDialogPane().getStylesheets().add(
                ConfirmDialog.class.getResource("/css/dialog.css").toExternalForm()
        );
        alert.getDialogPane().getStyleClass().add("custom-dialog");
        Optional<ButtonType> result = alert.showAndWait();
        return result.isPresent() && result.get() == ButtonType.OK;
    }
}
